PRO MAIN_LC8VFC_Propress

  COMPILE_OPT idl2

  inputpath = 'D:\Lgz\LC81200382013335LGN01\'
  outputpath = 'D:\Lgz\out\'
  VIoutpath = 'D:\Lgz\VFCout\'

  PRINT, 'Landsat begins: ' + SYSTIME(/UTC)
  
  LandsatMetaFile = FILE_SEARCH(inputpath,'*_MTL.txt', COUNT=nMTLCount,$
    /TEST_READ, /FULLY_QUALIFY_PATH)

  ENVIFileName      = (strsplit(file_basename(LandsatMetaFile), '.', /extract))[0]
  VNIR_SWIRFileName = outputpath+ENVIFileName + '_rad.dat'
  VNIR_SWIRFileName1 = outputpath+ENVIFileName + '_rad_BIL.dat'

  L8CALIBRATE,LandsatMetaFile,VNIR_SWIRFileName,VNIR_SWIRFileName1

  Landsat_FLAASH_LC8,outputpath,ENVIFileName
 
  output_uri = outputpath+ENVIFileName + '_rad_flaash.dat'
  MAIN_VI_Propress,output_uri,VIoutpath



  PRINT, 'Landsat ends: ' + SYSTIME(/UTC)

end


